package org.example.chapter3.pojo;

import org.example.chapter3.pojo.definition.Animal;
import org.example.chapter3.pojo.definition.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * @author CoderXshuai
 * @date 2020/7/5/0005 23:54
 */
@Component
public class BusinessPerson implements Person {
    private Animal animal = null;

    @Override
    public void service() {
        this.animal.use();
    }

    @Override
    @Autowired
    @Qualifier("dog")
    public void setAnimal(Animal animal) {
        System.out.println("延迟");
        this.animal = animal;
    }
}
